/**
 * 财务工资小计部门维护
 */
app.controller('btnCtrl', ['$scope', '$http', BtnController]);
function BtnController($scope, $http){
    console.log('------$scope.menuId1-----', $scope.menuId);
    console.log('------$scope.buttonArr1-----', $scope.buttonArr);

    $scope.bindBtn = function(event) {
        var datas = $scope.getSelectedRows();
        switch(event){
            case 'event-to-add':
            {
                window.top.add_tab("财务工资小计部门维护 - 新增","/web/finance/tcwFinanceSalaryClassify/toAdd");
                break;
            }
            case 'event-to-edit':
            {
                if(datas.length == 0) {
                    layer.alert('尚未选中数据');
                } else if(datas.length > 1) {
                    layer.alert('只能选中一行数据');
                } else {
                    window.top.add_tab("财务工资小计部门维护 - 编辑","/web/finance/tcwFinanceSalaryClassify/toEdit?id="+ datas[0].id);
                }
                break;
            }


        };
    }
}


//表格双击
app.controller('dbClickCtrl', ['$scope', '$http', DbClickController]);
function DbClickController($scope, $http){
    $scope.doubleClick = function(data) {
        window.top.add_tab('财务工资小计部门维护 - 详情','/web/finance/tcwFinanceSalaryClassify/toDetail?id=' + data.id);
    }
}

